require "extern"

ProxyManager = {}

local allProxy = {}

function ProxyManager:getProxyByName(name)
	return allProxy[name]
end

function ProxyManager:register(proxy)
	if proxy ~= nil and proxy.name~= nil and allProxy[name]==nil then
		allProxy[name] = proxy
		proxy.name = name
	end
end

function ProxyManager:remove(proxy)
	if proxy == nil or proxy.name == nil then
		return
	end
	allMdt[proxy.name] = nil
	proxy.name = nil
end

function ProxyManager:removeByName(name)
	local proxy = allProxy[name]
	if proxy == nil then
		return
	end
	allProxy[name] = nil
	proxy.name = nil
end